package com.rich.house.service.impl;

import com.rich.common.entity.TbWant;
import com.rich.house.mapper.WantMapper;
import com.rich.house.service.WantService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;

/**
 * @Package: com.rich.house.service.impl
 * @Author: 张dy
 * @Date: Created in 2021/8/13 下午 7:36
 */
@Service
public class WantServiceImpl implements WantService {

    @Autowired
    private WantMapper wantMapper;

    @Override
    public List<TbWant> findAll() {
        return wantMapper.findAll();
    }

    @Override
    public List<TbWant> findByStatus(TbWant want,String status) {

        return wantMapper.findByStatus(want);

    }

    @Override
    public void addWant(TbWant want, Long userId, String status) {
        //初始化信息
        want.setUid(userId);
        want.setStatus(status);
        want.setCreateTime(new Date());
        wantMapper.addWant(want);
    }
}
